﻿using System.Collections.Generic;
using System.Linq;

namespace Bilibili.Model.Resource
{
    public sealed class QualityInfo
    {
        public QualityInfo(int qn, string description)
        {
            Qn = qn;
            Description = description;
        }
        public QualityInfo(int qn, string description, DashInfoModel dash) : this(qn, description)
        {
            AudioUrls = dash.Audio?.Select(x => x.BaseUrl).ToList();
            VideoUrls = dash.Video?.Where(x => x.Id == qn)?.Select(x => x.BaseUrl).ToList();
        }
        public int Qn { get; set; }
        public string Description { get; set; }
        public List<string> AudioUrls { get; set; }
        public List<string> VideoUrls { get; set; }
    }
}